home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / System / Warp3D / Install_Warp3D < prev    next >
Text File  |  2001-04-02  |  10KB  |  435 lines

  1. ; $VER: Installation script for Warp3D 1.0 ( 5. Dezember 1998)
  2. ; © Thomas & Hans-Jörg Frieden
  3. ; Created with GoldED 5.0
  4. ; Adapted for V2 beta, 04-Feb-99
  5. ; check if we are running under correct OS
  6.  
  7. (set #version (/ @installer-version 65536))
  8.  
  9. (if (< (/ (getversion) 65536) 39)
  10.     (
  11.         (abort "Incorrect OS version (software requires OS 39 or better )!")
  12.     )
  13. )
  14.  
  15. ; error handling
  16.  
  17. ;
  18. ; Procedure to copy a single library
  19. (procedure P_copy_single arg1 arg2 arg3
  20.         (copylib
  21.                 (confirm)
  22.                 (prompt arg3)
  23.                 (help @copylib-help)
  24.                 (source arg1)
  25.                 (dest arg2)
  26.                 (optional "oknodelete" "askuser")
  27.         )
  28. )
  29.  
  30. ;
  31. ; How can it be there's no way of specifying an environment variable?
  32. (procedure P_setenv arg1 arg2
  33.         (
  34.                 (if (exists (tackon "ENV:" arg1) (noreq))
  35.                         (delete (tackon "ENV:" arg1))
  36.                 )
  37.                 (if (exists (tackon "ENVARC:" arg1) (noreq))
  38.                         (delete (tackon "ENVARC:" arg1))
  39.                 )
  40.                 (textfile
  41.                         (dest (tackon "ENV:" arg1))
  42.                         (append arg2)
  43.                 )
  44.                 (textfile
  45.                         (dest (tackon "ENVARC:" arg1))
  46.                         (append arg2)
  47.                 )
  48.         )
  49. )
  50.  
  51. ;
  52. ; Procedure to invalidate old version
  53. (procedure P_invalidate
  54.     (if (exists "libs:Warp3D" (noreq))
  55.       ( if (< (getversion "libs:Warp3D.library") 262144)
  56.         (
  57.         (message (cat "The installer will now invalidate your old installation by moving "
  58.                       "old files to a directory old_warp3d.")
  59.         )
  60.         ; make backup directory
  61.         (makedir "libs:old_warp3d")
  62.         (makedir "libs:old_warp3d/Warp3D")
  63.  
  64.         ; copy old stuff
  65.         (copyfiles
  66.             (source "Libs:Warp3D")
  67.             (dest "Libs:old_warp3d/Warp3D")
  68.             (infos)
  69.             (all)
  70.             (optional "nofail" "force" "askuser")
  71.         )
  72.         (copyfiles
  73.             (source "Libs:Warp3D.library")
  74.             (dest "Libs:old_warp3d")
  75.             (infos)
  76.             (all)
  77.             (optional "nofail" "force" "askuser")
  78.         )
  79.         (copyfiles
  80.             (source "Libs:Warp3DPPC.library")
  81.             (dest "Libs:old_warp3d")
  82.             (infos)
  83.             (all)
  84.             (optional "nofail" "force" "askuser")
  85.         )
  86.  
  87.         ; delete old files
  88.         (delete "libs:Warp3D.library" (optional "force"))
  89.         (delete "libs:Warp3DPPC.library" (optional "force"))
  90.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  91.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  92.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  93.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  94.         (delete "libs:Warp3D/" (optional "force"))
  95.  
  96.         (message (cat "The old libraries can now be found in libs:old_warp3d.")
  97.         )
  98.       )
  99.     )
  100.     )
  101. )
  102.  
  103.  
  104. (if (>= #version 44)
  105.     (
  106.         (effect "center" "radial" $ffffff $ffffff)
  107.         (showmedia "w3d" "Installer_Media/Warp3D.jpg" "upper_left" "none" 0)
  108.         (showmedia "3dw" "Installer_Media/3DWorld.jpg" "upper_right" "none" 0)
  109.     )
  110. )
  111.  
  112.  
  113. (onerror
  114.     (if (> @ioerr 0)
  115.         (
  116.             (message
  117.                 ("An error has occurred during installation. Please check the log file to understand the error.")
  118.             )
  119.         )
  120.     )
  121.     (exit (quiet))
  122. )
  123.  
  124. (set #installmode
  125.     (askbool
  126.         (prompt (cat
  127.             "Welcome to Warp3D.\n"
  128.             "Choose the installation mode.\n\n"
  129.             "If you have an older version of Warp3D installed, "
  130.             "you may want to choose uninstall now to avoid confusion with older drivers."
  131.             )
  132.         )
  133.         (help "Select Install if you want to install Warp3D, and Uninstall if you want to remove it. Warp3D is a hardware independent driver system for 3d accelerators.")
  134.         (choices
  135.             "Install"
  136.             "Uninstall"
  137.         )
  138.         (default 1)
  139.     )
  140. )
  141.  
  142. (if (= #installmode 1)
  143.     ; normal installation
  144.     (
  145.         (welcome (cat
  146.             "Welcome to the Warp3D installation. This utility will install or "
  147.             "update Warp3D, the hardware-independent 3D driver system, on your "
  148.             "Amiga. ")
  149.         )
  150.         (P_invalidate)
  151.  
  152.         (message "The Installation program will now create a new directory \"Warp3D\" in your LIBS directory where the Warp3D libraries will be installed.")
  153.         (makedir "Libs:Warp3D/")
  154.         (makedir "Libs:Warp3D/GFXdrivers")
  155.         (makedir "Libs:Warp3D/HWdrivers")
  156.         ; --- Try to find out if WarpUp is installed.
  157.         (if (exists "libs:Warp.library" (noreq))
  158.             (set #ppc 1)
  159.             (set #pcc 0)
  160.         )
  161.         (if (= #ppc 1)
  162.             (set #result
  163.                 (askbool
  164.                     (prompt "You seem to have WarpUp installed. Warp3D comes with a special PPC version that is usable for WarpUp applications. Do you want to install the PPC libraries, too?")
  165.                     (help @askbool-help)
  166.                     (choices "Yes" "No")
  167.                     (default 1)
  168.                 )
  169.             )
  170.             (if (= #result 0)
  171.                 (set #ppc 0)
  172.             )
  173.         )
  174.         (copylib
  175.             (prompt "Copying the master library")
  176.             (help @copylib-help)
  177.             (source "libs/Warp3D.library")
  178.             (dest "libs:")
  179.         )
  180.         (if (= #ppc 1)
  181.             (copylib
  182.                 (prompt "Copying the PPC master library")
  183.                 (help @copylib-help)
  184.                 (source "libs/Warp3DPPC.library")
  185.                 (dest "libs:")
  186.             )
  187.         )
  188.  
  189.         ; ask for graphics driver
  190.         (set #gfx_sys
  191.             (askoptions
  192.                 (prompt "Which graphics systems do you want to use with Warp3D ?")
  193.                 (help @askoptions-help)
  194.                 (choices
  195.                     "CyberGraphX V3/V4"
  196.                     "Picasso96"
  197.                 )
  198.                 (default (+ 1 2))
  199.             )
  200.         )
  201.  
  202.         ; if P96 is selected, install it
  203.         (if (BITAND #gfx_sys 2)
  204.          (
  205.             (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96.library"
  206.                            "libs:Warp3D/GFXdrivers"
  207.                            "Copy Picasso96 driver"
  208.             )
  209.             (if (= #ppc 1)
  210.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96_PPC.library"
  211.                                "libs:Warp3D/GFXdrivers"
  212.                                "Copy Picasso96 driver (PPC version)"
  213.                 )
  214.             )
  215.          )
  216.         )
  217.  
  218.         ; same for CGX, but ask for version first
  219.         (if (BITAND #gfx_sys 1)
  220.         (
  221.             (set #result
  222.                 (askchoice
  223.                     (prompt "What version of CyberGraphX do you have installed ?\n")
  224.                     (help @askchoice-help)
  225.                     (choices
  226.                         "CyberGraphX V3 (for CyberVision3D)"
  227.                         "CyberGraphX V3 (for CVPPC/BVPPC)"
  228.                         "CyberGraphX V4"
  229.                     )
  230.                     (default 2)
  231.                 )
  232.             )
  233.             ; assume the V4 driver will be installed, except when CVision3D is selected
  234.             (set #version 1)
  235.             (if (= #result 0)
  236.                 (set #version 0)
  237.             )
  238.  
  239.             (if (= #version 0)
  240.             (
  241.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX.library"
  242.                                "libs:Warp3D/GFXdrivers"
  243.                                "Copy CyberGraphX V3 driver"
  244.                 )
  245.                 (if (= #ppc 1)
  246.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX_PPC.library"
  247.                                    "libs:Warp3D/GFXdrivers"
  248.                                    "Copy CyberGraphX V3 driver (PPC version)"
  249.                     )
  250.                 )
  251.              )
  252.              (
  253.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4.library"
  254.                                "libs:Warp3D/GFXdrivers"
  255.                                "Copy CyberGraphX V4 driver"
  256.                 )
  257.                 (if (= #ppc 1)
  258.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4_PPC.library"
  259.                                    "libs:Warp3D/GFXdrivers"
  260.                                    "Copy CyberGraphX V4 driver (PPC version)"
  261.                     )
  262.                 )
  263.              )
  264.             )
  265.          )
  266.         )
  267.  
  268.         ; Try to find out the graphics card, assuming CVision3D
  269.         (set #graka 0)
  270.         (if (exists "devs:Monitors/CVision3D" (noreq))
  271.             (set #graka 0)
  272.         )
  273.         (if (exists "devs:Monitors/CVisionPPC" (noreq))
  274.             (set #graka 1)
  275.         )
  276.  
  277.         ; Ask for graphics card
  278.         (set #result
  279.             (askchoice
  280.                 (prompt "Please select the graphics device you want to use.")
  281.                 (help @askchoice-help)
  282.                 (choices
  283.                     "CyberVision64/3D"
  284.                     "CyberVisionPPC/BlizzardVisionPPC"
  285.                 )
  286.                 (default #graka)
  287.             )
  288.         )
  289.         (select #result
  290.             (
  291.                 (set #grdrv  "libs/Warp3D/HWdrivers/W3D_Virge.library")
  292.                 (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Virge_PPC.library")
  293.             )
  294.             (
  295.                 (set #grdrv  "libs/Warp3D/HWdrivers/W3D_Permedia2.library")
  296.                 (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Permedia2_PPC.library")
  297.             )
  298.         )
  299.         (copylib
  300.             (prompt "Copying the hardware driver library")
  301.             (help @copylib-help)
  302.             (source #grdrv)
  303.             (dest "libs:Warp3D/HWdrivers")
  304.         )
  305.         (if (= #ppc 1)
  306.             (copylib
  307.                 (prompt "Copying the PPC hardware driver library")
  308.                 (help @copylib-help)
  309.                 (source #grdrv2)
  310.                 (dest "libs:Warp3D/HWdrivers")
  311.             )
  312.  
  313.         )
  314.         (if (= #result 1)
  315.          (
  316.             ; Take special steps for Permedia driver
  317.             (makedir "ENV:Warp3D")
  318.             (makedir "ENV:Warp3D/Permedia2")
  319.             (makedir "ENVARC:Warp3D")
  320.             (makedir "ENVARC:Warp3D/Permedia2")
  321.             (P_setenv "Warp3D/Permedia2/Dither" "on")
  322.             (set #result
  323.                 (askbool
  324.                     (prompt (cat "For the Permedia2 driver to work correctly, semaphore "
  325.                                  "locking is required. This is done by setting the environment "
  326.                                  "variable CyberGraphX/USESEMAPHORES to 1. See the documentation for more details. "
  327.                                  "Should the installer program do this now ?")
  328.                     )
  329.                     (help @askbool-help)
  330.                     (choices
  331.                         "Yes"
  332.                         "No"
  333.                     )
  334.                     (default 1)
  335.                 )
  336.             )
  337.             (if (= #result 1)
  338.                 (P_setenv "CyberGraphX/USESEMAPHORES" "1" )
  339.                 (message "Ok, but remember that you may run into troubles later!")
  340.             )
  341.  
  342.          )
  343.         )
  344.         ; Ask for demo installation
  345.         (set #result
  346.             (askbool
  347.                 (prompt "Do you want to install the demo?")
  348.                 (help @askbool-help)
  349.                 (choices
  350.                     "Yes"
  351.                     "No"
  352.                 )
  353.                 (default 1)
  354.             )
  355.         )
  356.         (if (= #result 1) (
  357.                 (set #demodest
  358.                     (askdir
  359.                         (prompt "Select a location to install the Demo. A Drawer \"W3DDemo\" will be created")
  360.                         (help @askdir-help)
  361.                         (newpath)
  362.                         (default "ram:")
  363.                     )
  364.                 )
  365.                 (if (NOT (exists #demodest))
  366.                     (makedir #demodest)
  367.                 )
  368.                 (copyfiles
  369.                     (source "demo/")
  370.                     (dest (tackon #demodest "W3DDemo"))
  371.                     (infos)
  372.                     (all)
  373.                     (optional "oknodelete" "force" "askuser")
  374.                 )
  375.             )
  376.         )
  377.         (set #result
  378.             (askbool
  379.                 (prompt "Do you want to Install the User's Guide?")
  380.                 (help @askbool-help)
  381.                 (choices
  382.                     "Yes"
  383.                     "No"
  384.                 )
  385.                 (default 1)
  386.             )
  387.         )
  388.         (if (= #result 1)
  389.             (
  390.                 (set #destdoc (askdir
  391.                         (prompt "Select the place to install the documentation. A drawer \"docs\" will be created.")
  392.                         (help @askdir-help)
  393.                         (newpath)
  394.                         (default "HELP:")
  395.                     )
  396.                 )
  397.                 (copyfiles
  398.                     (prompt "Copying documentation files")
  399.                     (help @copyfiles-help)
  400.                     (source "Docs")
  401.                     (infos)
  402.                     (all)
  403.                     (dest (tackon #destdoc "Docs"))
  404.                 )
  405.             )
  406.         )
  407.  
  408.         (exit "Warp3D has been installed on your system.\n"
  409.               "For more information on Warp3D, check out the 3d World website:\n"
  410.               "http://www.haage-partner.com/3dworld\n"
  411.               "You'll also find information on how to subscribe to the "
  412.               "3DWorld mailing list.\n\n"
  413.               "Have fun with Warp3D!")
  414.     )
  415.  
  416.     ; uninstall application
  417.  
  418.     (
  419.         ; --- insert your code below ---
  420.         (delete "libs:Warp3D.library" (optional "force"))
  421.         (delete "libs:Warp3DPPC.library" (optional "force"))
  422.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  423.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  424.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  425.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  426.         (delete "libs:Warp3D/" (optional "force"))
  427.         ; -- end of your code ---
  428.  
  429.         (message "Uninstallation completed. The demo and documentation must be deleted manually.")
  430.  
  431.         (exit (quiet))
  432.     )
  433. )
  434.  
  435.